/**
 * 
 */
package com.iptv;

import java.util.List;

import com.base.Operation;
import com.base.OperationObject;
import com.common.CommonOperation;
import com.common.CommonOperationObject;
import com.common.CommonUser;
import com.common.enumeration.BaseOperationEnum;
import com.common.enumeration.OperationObjectType;
import com.iptv.channel.Channel;
import com.iptv.entity.device.SetTopBox;

/**
 * @author 7738
 *
 */
public class IPTVUser extends CommonUser implements IIPTVUser {
	private SetTopBox setTopBox;

	@Override
	public List<Program> getProgramList(String operationObjectCode) {
		// TODO Auto-generated method stub
		OperationObject operationObject = new CommonOperationObject();
		operationObject.setCode(operationObjectCode);
		operationObject.setExpandChildOperationObjectType(OperationObjectType.PROGRAM);
		Operation operation = new CommonOperation();
		operation.setCode(BaseOperationEnum.EXPAND.name());
		
		return super.retrieve(operation, operationObject);
	}

	@Override
	public List<Channel> getChannelList(String operationObjectCode) {
		// TODO Auto-generated method stub
		OperationObject operationObject = new CommonOperationObject();
		operationObject.setCode(operationObjectCode);
		operationObject.setExpandChildOperationObjectType(OperationObjectType.CHANNEL);
		Operation operation = new CommonOperation();
		operation.setCode(BaseOperationEnum.EXPAND.name());
		
		return super.retrieve(operation, operationObject);
	}

	@Override
	public boolean watchProgram() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean watchChannel(Channel channel) {
		// TODO Auto-generated method stub
		if (channel.getChannelNumber() == 100) {
			return false;
		} else {
			return super.access(channel);
		}
		
	}

	@Override
	public boolean addChannel(Channel channel) {
		// TODO Auto-generated method stub
		return super.add(channel);
	}
	
}
